package cn.shujuhai.common.domain;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: NiuYaHu
 * @Date: 2025/5/23 10:34
 * @Description:
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoginRequest {
    @NotBlank(message = "用户名不能为空")
    @Size(max = 15, message = "用户名长度不能超过15个字符")
    @Pattern(regexp = "^[a-zA-Z0-9][a-zA-Z0-9_]*$", message = "用户名只能是字母、数字和下划线的组合，且不能以下划线开始")
    private String uname;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 40, message = "密码长度必须在6到40个字符之间")
    private String pwd;

    @NotBlank(message = "验证码ID不能为空")
    private String captchaId;

    @NotBlank(message = "滑块验证参数不能为空")
    private String userX;
}
